Think about backup again

最近发生的两件事情让我再次思考如何备份自己的数据,一个是同事的IBM T42相继报废,另外就是访问国外网站越来越困难了。目前我的备份方式很原始,手工备份,外加几个使用rsync的脚本,自动化程度较低。公司里的数据肯定不能备份到外网,自己也有电子书、片子和音乐什么的,不方便放出来,所以需要一个可以自己搭建的备份方案。

我的私人网络数据备份做得不错,基本都有备份,除了Google Docs里的文档。

Git remote pushurl

从git 1.6.4起,有了一个新的控制选项——remote.$name.pushurl,官方解释如下:

“git push $name” honors remote.$name.pushurl if present before using remote.$name.url. In other words, the URL used for fetching and pushing can be different.

也就是说,你可以有一个url用来取,一个url用来提交,下面是一个配置的例子

[remote "gitweb"]
        pushurl = ssh://me@example.com/gitrepo/mypj.git
        url = git://example.com/mypj.git
        fetch = +refs/heads/*:refs/remotes/gitweb/*